#!/bin/bash

# 遍历当前文件夹及其子文件夹，忽略 .git 文件夹
find . -type d -name .git -prune -o -type f -exec sh -c '
    for filepath; do
        # 打印当前处理的文件路径
        echo "Processing file: $filepath"
        # 修改文件路径
        new_filepath=$(echo "$filepath" | sed "s/org\/dromara/com\/ryz/g")
        # 如果文件路径有修改，则打印修改后的路径，并重命名文件
        if [ "$filepath" != "$new_filepath" ]; then
            echo "  Renaming: $filepath -> $new_filepath"
            mv "$filepath" "$new_filepath"
        else
            echo "  No renaming needed for: $filepath"
        fi
    done
' sh {} +
